home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / libx11 / include / x11 / xos.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  3KB  |  161 lines

  1. /*
  2.  * $XConsortium: Xos.h,v 1.47 91/08/17 17:14:38 rws Exp $
  3.  * 
  4.  * Copyright 1987 by the Massachusetts Institute of Technology
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software and its
  7.  * documentation for any purpose and without fee is hereby granted, provided 
  8.  * that the above copyright notice appear in all copies and that both that 
  9.  * copyright notice and this permission notice appear in supporting 
  10.  * documentation, and that the name of M.I.T. not be used in advertising
  11.  * or publicity pertaining to distribution of the software without specific, 
  12.  * written prior permission. M.I.T. makes no representations about the 
  13.  * suitability of this software for any purpose.  It is provided "as is"
  14.  * without express or implied warranty.
  15.  *
  16.  * The X Window System is a Trademark of MIT.
  17.  *
  18.  */
  19.  
  20. /* This is a collection of things to try and minimize system dependencies
  21.  * in a "signficant" number of source files.
  22.  */
  23.  
  24. #ifndef _XOS_H_
  25. #define _XOS_H_
  26.  
  27. #include <X11/Xosdefs.h>
  28.  
  29. /*
  30.  * Get major data types (esp. caddr_t)
  31.  */
  32.  
  33. #ifdef USG
  34. #ifndef __TYPES__
  35. #ifdef CRAY
  36. #define word word_t
  37. #endif /* CRAY */
  38. #include <sys/types.h>            /* forgot to protect it... */
  39. #define __TYPES__
  40. #endif /* __TYPES__ */
  41. #else /* USG */
  42. #if defined(_POSIX_SOURCE) && defined(MOTOROLA)
  43. #undef _POSIX_SOURCE
  44. #include <sys/types.h>
  45. #define _POSIX_SOURCE
  46. #else
  47. #include <sys/types.h>
  48. #endif
  49. #endif /* USG */
  50.  
  51.  
  52. /*
  53.  * Just about everyone needs the strings routines.  We provide both forms here,
  54.  * index/rindex and strchr/strrchr, so any systems that don't provide them all
  55.  * need to have #defines here.
  56.  */
  57.  
  58. #ifndef X_NOT_STDC_ENV
  59. #include <string.h>
  60. #ifndef AMIGA
  61. #define index strchr
  62. #define rindex strrchr
  63. #endif
  64. #else
  65. #ifdef SYSV
  66. #include <string.h>
  67. #define index strchr
  68. #define rindex strrchr
  69. #else
  70. #include <strings.h>
  71. #define strchr index
  72. #define strrchr rindex
  73. #endif
  74. #endif
  75.  
  76.  
  77. /*
  78.  * Get open(2) constants
  79.  */
  80. #ifdef X_NOT_POSIX
  81. #include <fcntl.h>
  82. #ifdef USL
  83. #include <unistd.h>
  84. #endif /* USL */
  85. #ifdef CRAY
  86. #include <unistd.h>
  87. #endif /* CRAY */
  88. #ifdef MOTOROLA
  89. #include <unistd.h>
  90. #endif /* MOTOROLA */
  91. #ifdef SYSV386
  92. #include <unistd.h>
  93. #endif /* SYSV386 */
  94. #include <sys/file.h>
  95. #else /* X_NOT_POSIX */
  96. #if !defined(_POSIX_SOURCE) && defined(macII)
  97. #define _POSIX_SOURCE
  98. #include <fcntl.h>
  99. #undef _POSIX_SOURCE
  100. #else
  101. #include <fcntl.h>
  102. #endif
  103. #include <unistd.h>
  104. #endif /* X_NOT_POSIX else */
  105.  
  106. /*
  107.  * Get struct timeval
  108.  */
  109.  
  110. #ifdef SYSV
  111.  
  112. /*
  113. #ifndef USL
  114. #include <sys/time.h>
  115. #endif
  116. */
  117. #include <time.h>
  118. #ifdef CRAY
  119. #undef word
  120. #endif /* CRAY */
  121. #if defined(USG) && !defined(CRAY) && !defined(MOTOROLA) && !defined(__hpux)
  122. struct timeval {
  123.     long tv_sec;
  124.     long tv_usec;
  125. };
  126. #ifndef USL_SHARELIB
  127. struct timezone {
  128.     int tz_minuteswest;
  129.     int tz_dsttime;
  130. };
  131. #endif /* USL_SHARELIB */
  132. #endif /* USG */
  133.  
  134. #else /* not SYSV */
  135.  
  136. #if defined(_POSIX_SOURCE) && defined(SVR4)
  137. /* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
  138. #undef _POSIX_SOURCE
  139. /*
  140. #include <sys/time.h>
  141. */
  142. #define _POSIX_SOURCE
  143. #else
  144. /*
  145. #include <sys/time.h>
  146. */
  147. #endif
  148.  
  149. #endif /* SYSV */
  150.  
  151. /* use POSIX name for signal */
  152. #if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD)
  153. #define SIGCHLD SIGCLD
  154. #endif
  155.  
  156. #ifdef ISC
  157. #include <sys/bsdtypes.h>
  158. #endif
  159.  
  160. #endif /* _XOS_H_ */
  161.